#include<iostream>
using namespace std;
int main()
{
	int n;
	while (cin >> n) {
		if (n == -1) {
			break;
		}
		long long a = 0;
		long long b = 1;
		long long sum = 1;
		if (n == 0) {
			cout << a << endl;
		}
		else if (n == 1) {
			cout << b << endl;
		}
		else {
			for (int i = 2; i <= n; i++) {
				sum = a + b;
				a = b;
				b = sum;
			}
			cout << sum << endl;
		}
		
	}
	return 0;
}